﻿using System;
using System.ServiceModel;
using XchangeStreamer.Core.Subscriber;
using System.ServiceModel.Channels;

namespace XchangeStreamer.Subscriber.SDK
{
    internal sealed class Subscriber : DuplexClientBase<ISubscriber>, ISubscriber
    {
        #region Public Const.

        public Subscriber(InstanceContext callbackInstance, Binding binding, EndpointAddress endpointAddress)
            : base(callbackInstance, binding, endpointAddress)
        {
        }

        #endregion

        #region ISubscriber Members

        public void Subscribe(int topicId)
        {
            base.Channel.Subscribe(topicId);
        }

        public void Unsubscribe(int topicId)
        {
            base.Channel.Unsubscribe(topicId);
        }

        public void Connect()
        {
            base.Channel.Connect();
        }

        public void Disconnect()
        {
            base.Channel.Disconnect();
        }

        #endregion
    }
}